home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / diffs / make-3.71 / dir.c < prev    next >
Encoding:
Text File  |  1994-08-05  |  1.7 KB  |  74 lines

  1. *** orig/make-3.71/dir.c    Thu Jul 21 01:29:56 1994
  2. --- src/make-3.71/dir.c    Thu Jul 21 01:32:44 1994
  3. ***************
  4. *** 47,52 ****
  5. --- 47,88 ----
  6.   #define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
  7.   #endif /* POSIX */
  8.   
  9. + #ifdef __MSDOS__
  10. + #include <ctype.h>
  11. + char *dosify(char *filename)
  12. + {
  13. +   static char dos_filename[14];
  14. +   char *df;
  15. +   int i;
  16. +   if (filename == 0)
  17. +     return 0;
  18. +   if (strpbrk(filename, "\"*+,;<=>?[\\]|"))
  19. +     return filename;
  20. +   df = dos_filename;
  21. +   /* first, transform the name part */
  22. +   for (i=0; *filename && i<8 && *filename != '.'; i++)
  23. +     *df++ = tolower(*filename++);
  24. +   /* now skip to the next dot */
  25. +   while (*filename && *filename != '.')
  26. +     filename ++;
  27. +   if (*filename)
  28. +   {
  29. +     *df++ = *filename++;
  30. +     for (i=0; *filename && i<3 && *filename != '.'; i++)
  31. +       *df++ = tolower(*filename++);
  32. +   }
  33. +   /* look for more dots */
  34. +   while (*filename && *filename != '.')
  35. +     filename++;
  36. +   if (*filename == '.')
  37. +     return filename;
  38. +   *df = 0;
  39. +   return dos_filename;
  40. + }
  41. + #endif /* __MSDOS__ */
  42.   /* Hash table of directories.  */
  43.   
  44.   #ifndef    DIRECTORY_BUCKETS
  45. ***************
  46. *** 213,218 ****
  47. --- 249,258 ----
  48.       /* The directory could not be stat'd or opened.  */
  49.       return 0;
  50.   
  51. + #ifdef __MSDOS__
  52. +   filename = dosify(filename);
  53. + #endif
  54.     hash = 0;
  55.     if (filename != 0)
  56.       {
  57. ***************
  58. *** 403,408 ****
  59. --- 443,452 ----
  60.     if (dir == 0 || dir->files == 0)
  61.       /* There are no files entered for this directory.  */
  62.       return 0;
  63. + #ifdef __MSDOS__
  64. +   p = filename = dosify(p);
  65. + #endif
  66.   
  67.     for (hash = 0; *p != '\0'; ++p)
  68.       HASH (hash, *p);
  69.